package cn.miao.client;

import cn.miao.hrm.domain.Login;
import cn.miao.hrm.dto.LoginAgencyDto;
import cn.miao.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @program: springcloud-hrm
 * @description:
 * @author: MiaoWei
 * @create: 2021-11-22 21:30
 **/
@FeignClient(value = "SERVICE-AUTH",fallbackFactory =LoginFeginClientFallback.class)
@RequestMapping("/login")
public interface LoginFeginClient {

    /**
     * 保存登录和角色
     *
     * @param login 登录
     * @return {@link AjaxResult}
     */
    @PostMapping("/saveLoginAndRole")
    public AjaxResult saveLoginAndRole(@RequestBody LoginAgencyDto login);

    /**
     * 保存
     *
     * @param login 登录
     * @return {@link AjaxResult}
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public AjaxResult save(@RequestBody Login login);
}
